<template>
  <div>
    <a-card>
      <a-row style="margin-bottom: 10px">
        <a-col :span="24"  style="display: flex;flex-direction: row-reverse">
          <a-button v-print="'#printReport'" type="primary">打印报表</a-button>
        </a-col>
      </a-row>
      <div id="printReport">
        <a-row style="margin-bottom: 10px;">
          <a-col :span="6">
            部门：
          </a-col>
          <a-col :span="6">
            订单号：{{reportData[0].orderCode}}
          </a-col>
          <a-col :span="6">
            日期：{{reportData[0].birDay}}
          </a-col>
        </a-row>
        <table border="1" cellpadding="20" cellspacing="0" bordercolor="#000" style="width: 100%">
          <tr>
            <th colspan="20">
              <div style="position: relative;text-align: center">
<!--                <img src="@/assets/reportIcon.png" width="100px" height="30px" style="position: absolute;left: 0px;top:-5px"/>-->
                <span>退料单</span>
              </div>
            </th>
          </tr>
          <tr style="width: 100%" align="center">
            <th rowspan="2">序号</th>
            <th rowspan="2">物料料号</th>
            <th rowspan="2">客户料号</th>
            <th rowspan="2">品名</th>
            <th rowspan="2">规格</th>
            <th rowspan="2">单位</th>
            <th rowspan="2">退料数量</th>
            <th rowspan="2">实收数量</th>
            <th colspan="11">退料原因</th>
            <th rowspan="2">备注</th>
          </tr>
          <tr>
            <td>破损</td>
            <td>断裂</td>
            <td>划伤</td>
            <td>来料损件</td>
            <td>尺寸不符</td>
            <td>功能不良</td>
            <td>实物与焊盘不符</td>
            <td>料号不符</td>
            <td>线束不良</td>
            <td>型号不符</td>
            <td>其它</td>
          </tr>
          <tr v-for="(item,index) in reportData">
            <td>{{index+1}}</td>
            <td>{{item.materielCode}}</td>
            <td>{{item.clientCode}}</td>
            <td>{{item.materielName}}</td>
            <td>{{item.materielSpecs}}</td>
            <td>{{item.unit}}</td>
            <td>{{item.retreatNum}}</td>
            <td>{{item.uretreatNum}}</td>
            <td>{{item.reason1}}</td>
            <td>{{item.reason2}}</td>
            <td>{{item.reason3}}</td>

            <td>{{item.reason4}}</td>
            <td>{{item.reason5}}</td>
            <td>{{item.reason6}}</td>
            <td>{{item.reason7}}</td>
            <td>{{item.reason8}}</td>
            <td>{{item.reason9}}</td>
            <td>{{item.reason10}}</td>
            <td>{{item.reason11}}</td>
            <td>{{item.remarks}}</td>
          </tr>
        </table>
      </div>
    </a-card>
  </div>
</template>

<script>
export default {
  /** 退料单 **/
  name: 'ReturnMaterial',
  props:{
    reportData:{
      type:Array,
      default:()=>{[]}
    },
    type:{
      type:String,
      default:''
    },
    total1:{
      type:Number,
      default:0
    },
    total2:{
      type:Number,
      default:0
    },
  },
  data(){
    return {
      title:{
        '1':'插件抽测记录表',
        '2':'插件抽检记录表',
        '3':'SMT抽检记录表'
      }
    }
  }
}
</script>

<style scoped>

</style>